package com.ruoyi.custom.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.custom.mapper.StockPortfolioMapper;
import com.ruoyi.custom.domain.StockPortfolio;
import com.ruoyi.custom.service.IStockPortfolioService;

/**
 * 股票持仓Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-04
 */
@Service
public class StockPortfolioServiceImpl implements IStockPortfolioService 
{
    @Autowired
    private StockPortfolioMapper stockPortfolioMapper;

    /**
     * 查询股票持仓
     * 
     * @param id 股票持仓主键
     * @return 股票持仓
     */
    @Override
    public StockPortfolio selectStockPortfolioById(Long id)
    {
        return stockPortfolioMapper.selectStockPortfolioById(id);
    }

    /**
     * 查询股票持仓列表
     * 
     * @param stockPortfolio 股票持仓
     * @return 股票持仓
     */
    @Override
    public List<StockPortfolio> selectStockPortfolioList(StockPortfolio stockPortfolio)
    {
        return stockPortfolioMapper.selectStockPortfolioList(stockPortfolio);
    }

    /**
     * 新增股票持仓
     * 
     * @param stockPortfolio 股票持仓
     * @return 结果
     */
    @Override
    public int insertStockPortfolio(StockPortfolio stockPortfolio)
    {
        return stockPortfolioMapper.insertStockPortfolio(stockPortfolio);
    }

    /**
     * 修改股票持仓
     * 
     * @param stockPortfolio 股票持仓
     * @return 结果
     */
    @Override
    public int updateStockPortfolio(StockPortfolio stockPortfolio)
    {
        return stockPortfolioMapper.updateStockPortfolio(stockPortfolio);
    }

    /**
     * 批量删除股票持仓
     * 
     * @param ids 需要删除的股票持仓主键
     * @return 结果
     */
    @Override
    public int deleteStockPortfolioByIds(Long[] ids)
    {
        return stockPortfolioMapper.deleteStockPortfolioByIds(ids);
    }

    /**
     * 删除股票持仓信息
     * 
     * @param id 股票持仓主键
     * @return 结果
     */
    @Override
    public int deleteStockPortfolioById(Long id)
    {
        return stockPortfolioMapper.deleteStockPortfolioById(id);
    }
}
